package org.example.exp2.entity;

import lombok.Getter;
import lombok.Setter;
import org.example.exp2.common.Links;

@Getter
@Setter
public class PersonVO {

    private int personId;
    private String name;
    private int age;
    private String email;

    public PersonVO(int personId,String name,int age,String email){
        this.personId=personId;
        this.name=name;
        this.age=age;
        this.email=email;
    }

    private Links links;

    public void setLinks(String baseUri){
        //使用personId生成链接
        this.links = new Links(baseUri + "/persons/"+this.personId);
    }
}
